import React, { Component } from 'react';
import { ListGroupItem,Collapse } from 'reactstrap';

export default class ListView extends Component {
  static displayName = ListView.name;
  constructor(props){
    super(props);
    this.state = {item:[],bcollapse:false}
    // if(this.props.interval_call!==undefined){
    //   setInterval(()=>{
    //     this.props.interval_call();
    //   },1000*60)
    // }
  }
  render () {
    return (
        <>
          <ListGroupItem 
            onClick={e=>this.setState({bcollapse:!this.state.bcollapse})}
            style={{fontWeight:'bold'}}
          >
            {this.props.text}
          </ListGroupItem>
          <Collapse isOpen={this.state.bcollapse}>
            {this.props.children}
          </Collapse>
        </>
    );
  }
}
